﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.SharePoint;

namespace SharePointHarvester.Events {
    public delegate void ListItemFoundHandler( object sender, ListItemFoundEventArg e );

    /// <summary>
    /// Event args for when an Item is found
    /// </summary>
    public class ListItemFoundEventArg : EventArgs {
        /// <summary>
        /// The web that was found
        /// </summary>
        public SPWeb _spWeb;
        /// <summary>
        /// List that has been found
        /// </summary>
        public SPList _list;
        /// <summary>
        /// Item that has been found
        /// </summary>
        public SPListItem _item;

        public SPFile _file = null;

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="webFound"></param>
        /// <param name="list"></param>
        /// <param name="item"></param>
        public ListItemFoundEventArg( SPWeb webFound, SPList list, SPListItem item ) {
            _spWeb = webFound;
            _list = list;
            _item = item;
        }

        /// <summary>
        /// overloaded Constructor.  Adds a file if the event was looking for files
        /// </summary>
        /// <param name="webFound"></param>
        /// <param name="list"></param>
        /// <param name="item"></param>
        /// <param name="file"></param>
        public ListItemFoundEventArg( SPWeb webFound, SPList list, SPListItem item, SPFile file ) {
            _spWeb = webFound;
            _list = list;
            _item = item;
            _file = file;
        }

    }
}
